#ifndef GRAPHICSVIEW_H
#define GRAPHICSVIEW_H

#include <QtGui>
#include <QGLWidget>
#include <math.h>
#include "ui_graphicsview.h"

class GraphicsView: public QWidget, private Ui::GraphicsView
{
Q_OBJECT

public:

GraphicsView( QWidget * parent,
              bool already_tested,
              int saved_max_size );
~GraphicsView();
void set_image( const QPixmap & pixmap );

public slots:

void toggleOpenGL();
void setMatrix();
void zoomIn();
void zoomOut();
void zoomInP();
void zoomOutP();
void reset_rotation();
void reset_scale();

signals:

void return_gl_tested(bool, int);

private:

QGraphicsScene * scene;
QGraphicsPixmapItem * pixmap_item;
int scale;
bool use_opengl;
int max_size;
int pix_h;
int pix_w;
bool gl_tested;
void writeSettings();
void readSettings();

protected:

void closeEvent( QCloseEvent * e );

};

#endif // GRAPHICSVIEW_H
